package com.qd.panda.model;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.Setter;
import lombok.experimental.Accessors;

import java.io.Serializable;
import java.time.LocalDate;
import java.time.LocalDateTime;

/**
 * 卡卷明细
 *
 * @author sjk
 */
@Getter
@Setter
@Accessors(chain = true)
@EqualsAndHashCode(callSuper = false)
@TableName("panda_card_info_detail")
public class CardInfoDetail extends Model<CardInfoDetail> implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * 主键
     */
    @TableId(value = "card_id", type = IdType.ASSIGN_ID)
    private String cardId;
    /**
     * 用户手机号
     */
    @TableField("mobile")
    private String mobile;
    /**
     * 兑换时间
     */
    @TableField("redemption_time")
    private LocalDateTime redemptionTime;
    /**
     * 使用时间
     */
    @TableField("use_time")
    private LocalDateTime useTime;
    /**
     * 卷有效期
     */
    @TableField("validity_end_time")
    private LocalDate validityEndTime;
    /**
     * 兑换码
     */
    @TableField("redeem_code")
    private String redeemCode;
    /**
     * 状态:0未兑换1已兑换2已使用3已过期
     */
    @TableField("use_state")
    private Integer useState;
    /**
     * 用户ID
     */
    @TableField("user_id")
    private String userId;
    /**
     * 卷信息
     */
    @TableField("card_msg_id")
    private String cardMsgId;
    /**
     * 计划ID
     */
    @TableField("plan_id")
    private String planId;

    public void freeData() {
        this.cardId = null;
        this.mobile = null;
        this.redemptionTime = null;
        this.useTime = null;
        this.validityEndTime = null;
        this.redeemCode = null;
        this.useState = null;
        this.userId = null;
        this.cardMsgId = null;
        this.planId = null;
    }

}
